//电子邮件puhalskijsemen@gmail.com
//源码网站 开vpn全局模式打开 http://web3incubators.com/
//电报https://t.me/gamecode999
var o, e = require,
    t = module,
    n = exports,
    i = this && this.__extends || (o = function(e, t) {
        return (o = Object.setPrototypeOf || {
                __proto__: []
            }
            instanceof Array && function(e, t) {
                e.__proto__ = t;
            } || function(e, t) {
                for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i]);
            })(e, t);
    }, function(e, t) {
        function i() {
            this.constructor = e;
        }
        o(e, t), e.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype,
            new i());
    }),
    a = this && this.__decorate || function(e, t, i, o) {
        var s, n = arguments.length,
            a = n < 3 ? t : null === o ? o = Object.getOwnPropertyDescriptor(t, i) : o;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) a = Reflect.decorate(e, t, i, o);
        else
            for (var d = e.length - 1; 0 <= d; d--)(s = e[d]) && (a = (n < 3 ? s(a) : 3 < n ? s(t, i, a) : s(t, i)) || a);
        return 3 < n && a && Object.defineProperty(t, i, a), a;
    };

Object.defineProperty(n, "__esModule", {
    value: !0
}), n.ModelType = void 0;

var r, s = e("PlayerModel"),
    c = e("GameManager"),
    l = e("ArmView"),
    d = e("AudioManager"),
    u = e("FireView"),
    p = e("FillView"),
    h = e("JoystickCommon"),
    f = e("Global"),
    g = e("FollowCamera"),
    m = e("PetManager"),
    y = e("MachineModel"),
    v = e("MetamorphicModel"),
    w = e("GameMetamorphic"),
    b = e("GameConfig"),
    P = e("GameData"),
    I = e("EquipManager"),
    G = e("enum"),
    _ = e("RoleManager"),
    A = e("LoadManager"),
    k = e("SkillLaser"),
    M = e("GameLine"),
    C = e("Player"),
    D = e("GameMachine"),
    S = cc._decorator,
    O = S.ccclass,
    R = S.property;

! function(e) {
    e[e.DEFAULT = 0] = "DEFAULT", e[e.MACHINE = 1] = "MACHINE", e[e.METAMORPHIC = 2] = "METAMORPHIC";
}(r = n.ModelType || (n.ModelType = {}));

var T = function(o) {
    function e() {
        var e = null !== o && o.apply(this, arguments) || this;
        return e.modelType = r.DEFAULT, e.metamorphicModel = new v.default(), e.machineModel = new y.default(),
            e.pet = null, e.fillView = null, e.circle = null, e.line = null, e.fire = null,
            e.isIdle = !1, e.isFill = !1, e.isLine = !1, e.isHurt = !1, e.isShadow = !1, e.isBaoQing = !1,
            e.isYueBing = !1, e.isGouTou = !1, e.originPersonIdx = 0, e.isSkill = !1, e.aimTime = 0,
            e.aimTotalTime = 1.2, e.chargeTime = 0, e.chargeTotalTime = 2, e.skillList = [],
            e;
    }
    return i(e, o), e.prototype.start1 = function() {
            var i = this;
            this.loadSkin(this.model.personIdx).then(function() {
                -19 == i.model.personIdx ? i.changeAnimation({
                    animation: "animation6",
                    loop: !1,
                    flag: !0,
                    callback: function() {
                        i.changeGun(i.model.gunIdx);
                    }
                }) : i.changeGun(i.model.gunIdx);
            }), -29 != this.model.personIdx && 128 != this.model.personIdx || (this.model.addBuffer(s.BufferType.冲击),
                this.schedule(function() {
                    var e, t;
                    i.model.hasBuffer(s.BufferType.冲击) && ((e = new s.default()).RAN = 330, e.MOV = 100,
                        e.pow = 200, e.type = s.ArmType.冲击, e.ATK = 400 + Math.floor(20 * i.model.gunIdx),
                        (t = i.gameView.getArm().getComponent(l.default)) && (t.node.angle = 0, t.node.setParent(i.gameView.bulletLayout),
                            t.node.setPosition(i.node.getPosition()), t.init(i, e, cc.Vec2.ZERO, i.node.getPosition())));
                }, 2));
        }, e.prototype.getModel = function() {
            return this.modelType == r.METAMORPHIC ? this.metamorphicModel : this.modelType == r.MACHINE ? this.machineModel : this.model;
        }, e.prototype.loadModel = function(t, e) {
            void 0 === t && (t = P.GD.personIdx), void 0 === e && (e = P.GD.gunIdx), -1 < (this.originPersonIdx = t) ? 0 == f.G.personModelList.filter(function(e) {
                return e.id == t;
            }).length && (t = 0) : 0 == f.G.eggPersonModelList.filter(function(e) {
                return e.id == 1 - t;
            }).length && (t = 0);
            var i, o = f.G.getPersonModel(t),
                n = f.G.getGunModel(e);
            1e3 <= e && (1 == n.type ? n.ATK = Math.floor(40 + 3 * P.GD.topRank) : 11 == n.type ? n.ATK = Math.floor(40 + 5 * P.GD.topRank) : 8 == n.type || 15 == n.type ? n.ATK = 600 + 15 * P.GD.topRank : 3 == n.type || (5 == n.type ? n.ATK = 150 + 5 * P.GD.topRank : 9 == n.type && (n.ATK = 130 + 5 * P.GD.topRank)),
                    n.HP = 1009 == e ? 1e3 + 250 * P.GD.topRank : 1e3 + 150 * P.GD.topRank), this.model.openid == GA.Info.openId ? (i = 1,
                    (e = Math.max(0, Math.floor(P.GD.level / 3))) < b.GC.rankbuffer.length && (i += b.GC.rankbuffer[e] / 100),
                    i += f.G.losecount * b.GC.losebuffer / 100, this.model.MAX_HP = this.model.HP = Math.floor(_.default.getInstance().getProp(o.HP + n.HP, G.EquipPropType.HP_V) * i),
                    this.model.ATK = this.model.ATK_ORG = Math.floor(_.default.getInstance().getProp(o.ATK + n.ATK, G.EquipPropType.ATK_P) * i),
                    this.model.SPE = this.model.SPE_ORG = Math.floor(_.default.getInstance().getProp(o.SPE + n.SPE, G.EquipPropType.MOVE_P)),
                    this.model.CRI = _.default.getInstance().getProp(o.CRI + n.CRI, G.EquipPropType.CRI_P),
                    this.model.IDLE = _.default.getInstance().getProp(o.IDLE + n.IDLE, G.EquipPropType.SPE_P),
                    this.model.RAN = _.default.getInstance().getProp(n.RAN, G.EquipPropType.RAN_P),
                    this.model.miss = _.default.getInstance().getProp(0, G.EquipPropType.MISS_P), this.model.time = _.default.getInstance().getProp(n.time, G.EquipPropType.COOL_P)) : (this.model.MAX_HP = this.model.HP = Math.floor(_.default.getInstance().getProp(o.HP + n.HP, G.EquipPropType.HP_V, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList)),
                    this.model.ATK = this.model.ATK_ORG = Math.floor(_.default.getInstance().getProp(o.ATK + n.ATK, G.EquipPropType.ATK_P, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList)),
                    this.model.SPE = this.model.SPE_ORG = Math.floor(_.default.getInstance().getProp(o.SPE + n.SPE, G.EquipPropType.MOVE_P, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList)),
                    this.model.CRI = _.default.getInstance().getProp(o.CRI + n.CRI, G.EquipPropType.CRI_P, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList),
                    this.model.IDLE = _.default.getInstance().getProp(o.IDLE + n.IDLE, G.EquipPropType.SPE_P, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList),
                    this.model.RAN = _.default.getInstance().getProp(n.RAN, G.EquipPropType.RAN_P, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList),
                    this.model.miss = _.default.getInstance().getProp(0, G.EquipPropType.MISS_P, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList),
                    this.model.time = _.default.getInstance().getProp(n.time, G.EquipPropType.COOL_P, this.model.backEquipIdx, this.model.headEquipIdx, this.model.equipDataList)),
                c.default.getInstance().matchType == c.MatchType.三对三 && (this.model.ATK = this.model.ATK_ORG = this.model.ATK / 2),
                b.GC.isEquipEfffect && -1 < this.model.backEquipIdx && 2 == I.default.getInstance().getData(this.model.backEquipIdx, this.model.equipDataList).form && this.model.addBuffer(s.BufferType.加速), -22 == this.model.personIdx || 121 == this.model.personIdx || -29 == this.model.personIdx || 128 == this.model.personIdx ? (this.model.addBuffer(s.BufferType.加速),
                    this.model.SPE = this.model.SPE + 200) : -26 == this.model.personIdx || 125 == this.model.personIdx || -29 == this.model.personIdx || 128 == this.model.personIdx ? (this.model.addBuffer(s.BufferType.护盾),
                    this.metamorphicModel.HP = 2e3) : -27 == this.model.personIdx || 126 == this.model.personIdx || -29 == this.model.personIdx || 128 == this.model.personIdx ? this.model.IDLE = .7 * this.model.IDLE : -28 != this.model.personIdx && 127 != this.model.personIdx && -29 != this.model.personIdx && 128 != this.model.personIdx || (this.model.miss = this.model.miss + 40),
                this.model.ROT = n.ROT, this.model.MOV = n.MOV, this.model.bullet = n.bullet, this.model.fire = n.fire,
                this.model.type = n.type, this.model.num = n.num, this.model.total = n.total, this.model.pow = n.pow,
                this.machineModel.group = this.model.group, this.machineModel.initModel(this.model.gunIdx),
                this.metamorphicModel.initModel(this.model), this.slotName = n.slot;
        }, e.prototype.changeGun = function(e) {
            var t = this,
                i = f.G.getGunModel(e);
            this.loadGun(e).then(function() {
                "shouqiang" == i.slot ? (t.sprite.node.anchorX = .65, t.sprite.node.anchorY = .4) : "changqiang" == i.slot ? (i.type == s.ArmType.狙击枪 ? t.sprite.node.anchorX = .7 : t.sprite.node.anchorX = .66,
                    t.sprite.node.anchorY = .37) : (t.sprite.node.anchorX = .5, t.sprite.node.anchorY = .5);
            });
        }, e.prototype.loadGun = function(o) {

            var s = this;
            return this.modelType == r.MACHINE ? D.default.getInstance().loadGun(this) : new Promise(function(t, e) {
                var i = 3e3 <= o ? "texture/armOlympic/" + o : 2e3 <= o ? "image/arm_draw/" + f.G.getDrawIdx(o) : 1e3 <= o || o < 0 ? "image/arm3/" + f.G.getEggIdx(o) : "image/arm/" + o;
                s.sprite ? A.default.getInstance().loadSpriteFrame({
                    url: i,
                    sprite: s.sprite,
                    success: function() {
                        s.sprite instanceof cc.Sprite && (s.sprite.node.angle = 1008 == o ? 0 : 33, s.sprite.node.scaleX = s.skeleton.node.scaleX,
                                s.sprite.node.scaleY = s.skeleton.node.scaleY, s.sprite.node.setContentSize(200, 200),
                                s.sprite.node.setPosition(cc.v2(s.slot.bone.worldX * s.skeleton.node.scaleX, s.slot.bone.worldY * s.skeleton.node.scaleY - 20))),
                            t();
                    },
                    fail: function() {
                        e();
                    }
                }) : s.gameView.appendSprite({
                    url: i,
                    root: s.node,
                    pos: cc.v2(s.slot.bone.worldX * s.skeleton.node.scaleX, s.slot.bone.worldY * s.skeleton.node.scaleY - 20)
                }).then(function(e) {
                    s.sprite = e, s.sprite instanceof cc.Sprite && (s.sprite.node.angle = 1008 == o ? 0 : 33,
                        s.sprite.node.scaleX = s.skeleton.node.scaleX, s.sprite.node.scaleY = s.skeleton.node.scaleY,
                        s.sprite.node.setContentSize(200, 200)), t();
                }).catch(function() {
                    e();
                });
            });
        }, e.prototype.loadSkin = function(o) {
            var s = this;
            return void 0 === o && (o = P.GD.personIdx), this.modelType == r.METAMORPHIC ? w.default.getInstance().loadSkin(this) : this.modelType == r.MACHINE ? D.default.getInstance().loadSkin(this) : new Promise(function(t, i) {
                var e = o < 0 ? "skin/" + (f.G.getEggIdx(o, 2) + 100) + "/skeleton" : "skin/" + o + "/skeleton";
                A.default.getInstance().loadRes({
                    url: e,
                    type: sp.SkeletonData
                }).then(function(e) {
                    s.skeleton && e instanceof sp.SkeletonData && (s.skeleton.node.setPosition(cc.v2(0, -20)),
                        s.skeleton.skeletonData = e, s.changeAnimation({
                            animation: "animation2",
                            loop: !0
                        }), s.slot = s.skeleton.findSlot(s.slotName), -17 == s.model.personIdx && 1008 == s.model.gunIdx ? s.hpView.node.y = 135 : s.hpView.node.y = 85, -22 != s.model.personIdx && 121 != s.model.personIdx || s.skeleton.setAttachment("lian", "lian-2"),
                        s.loadEquip(o)), t();
                }).catch(function(e) {
                    console.error(e), s.skeleton && (s.slot = s.skeleton.findSlot(s.slotName)), i();
                });
            });
        }, e.prototype.loadEquip = function(t, e, i) {
            var o, s, n = this;
            void 0 === e && (e = this.model.backEquipIdx), void 0 === i && (i = this.model.headEquipIdx);
            try {
                -1 < e ? (o = I.default.getInstance().getConfig(e), s = I.default.getInstance().getData(e, this.model.equipDataList),
                    o.list[s.form].forEach(function(e) {
                        [17, 18, 19, 20, 21, 22, 116, -17].includes(t) ? n.skeleton.findSlot(e.slot) && n.skeleton.setAttachment(e.slot, e.attachment) : n.skeleton.findSlot(e.slot) && n.skeleton.setAttachment(e.slot, e.attachment && (t < 105 && -1 < t || 112 == t || -16 == t) ? "ren/" + e.attachment : e.attachment);
                    })) : (this.skeleton.findSlot("zuo") && this.skeleton.setAttachment("zuo", null),
                    this.skeleton.findSlot("you") && this.skeleton.setAttachment("you", null)), -1 < i ? (o = I.default.getInstance().getConfig(i),
                    s = I.default.getInstance().getData(i), o.list[s.form].forEach(function(e) {
                        [17, 18, 19, 20, 21, 22, 116, -17].includes(t) ? "jiaozuo" == e.slot ? n.skeleton.findSlot("zuojijiao") && n.skeleton.setAttachment("zuojijiao", e.attachment) : "jiaoyou" == e.slot ? n.skeleton.findSlot("youjijiao") && n.skeleton.setAttachment("youjijiao", e.attachment) : n.skeleton.findSlot(e.slot) && n.skeleton.setAttachment(e.slot, e.attachment) : n.skeleton.setAttachment(e.slot, e.attachment && (t < 105 && -1 < t || 112 == t || -16 == t) ? "ren/" + e.attachment : e.attachment);
                    })) : ([17, 18, 19, 20, 21, 22, 116, -17].includes(t) ? (this.skeleton.setAttachment("zuojijiao", null),
                    this.skeleton.setAttachment("youjijiao", null)) : (this.skeleton.setAttachment("jiaozuo", null),
                    this.skeleton.setAttachment("jiaoyou", null)), this.skeleton.setAttachment("guanghuan", null));
            } catch (e) {
                cc.error(e);
            }
        }, e.prototype.init = function() {

            console.error("player init");

            var e, t;
            this.gameView = c.default.getInstance().gameView, -1 < f.G.tryPersonIdx && (this.model.personIdx = f.G.tryPersonIdx,
                    (!f.G.tryPersonMap.has(f.G.tryPersonIdx) || f.G.tryPersonMap.get(f.G.tryPersonIdx).time < Date.now()) && (f.G.tryPersonIdx = -1)), -1 < f.G.tryGunIdx && (this.model.gunIdx = f.G.tryGunIdx, f.G.tryGunIdx = -1), -1 < f.G.tryMachineIdx && (this.modelType = r.MACHINE,
                    f.G.tryMachineIdx = -1), this.loadModel(this.model.personIdx, this.model.gunIdx),
                this.load(), this.hpView.init(this.getModel().MAX_HP), this.randPos(), -1 < f.G.tryPetIdx ? (t = m.default.getInstance().getConfig(),
                    this.appendPet({
                        id: t.id,
                        hp: m.default.getInstance().getHp(P.GD.petDataIdx, 30),
                        form: Math.min(f.G.tryPetIdx % 100, t.form),
                        lv: 30
                    }), f.G.tryPetIdx = -1, m.default.getInstance().isHas() || (P.GD.petDataIdx = P.GD.lastPetDataIdx)) : m.default.getInstance().isHas() && !f.G.chargeList[P.GD.petDataIdx] && (e = m.default.getInstance().getRealData(),
                    t = m.default.getInstance().getConfig(), this.appendPet({
                        id: t.id,
                        hp: e.hp,
                        form: Math.min(e.form, t.form),
                        lv: e.lv
                    }));

            this.start1();

        }, e.prototype.appendPet = function(e) {
            var t = this.gameView.getPet();
            t && (this.pet = t.getComponent("PlayerPet"), this.pet && (t.parent = this.gameView.layout,
                t.position = this.node.position, t.active = !0, this.pet.showLabel(), this.pet.initPet(this, e),
                t.position = this.pet.check(this.node.getPosition().add(cc.v2(60, 0)))));
        }, e.prototype.initData = function(e) {
            this.model = e;
        }, e.prototype.randPos = function() {
            this.gameView && this.node.setPosition(this.gameView.getEmptyGird().scaleSelf(cc.v2(this.node.width, this.node.height)).addSelf(cc.v2((this.node.width - this.gameView.map.width) / 2, (this.node.height - this.gameView.map.height) / 2)));
        }, e.prototype.restart = function() {
            var i = this;
            this && this.model && this.model.isDead() && (cc.log("restart"), this.isIdle = !1,
                this.isFill = !1, this.isHurt = !1, this.model.restart(), this.node && (cc.Tween.stopAllByTarget(this.node),
                    this.node.scale = 1, this.node.opacity = 255, this.node.angle = 0, this.node.active = !0),
                this.randPos(), this.resumeMove(!0), this.hpView && (this.hpView.node.active = !0,
                    this.hpView.reset()), this.skeleton && (this.skeleton.node.opacity = 255, this.skeleton.node.color = cc.Color.WHITE,
                    this.skeleton.node.setPosition(cc.v2(0, -20)), this.skeleton.unscheduleAllCallbacks()),
                this.model.addBuffer(s.BufferType.无敌), this.model.addBuffer(s.BufferType.变身), this.loadSkin(this.originPersonIdx).then(function() {
                    i.changeAnimation({
                            animation: "animation2",
                            loop: !0,
                            flag: !0
                        }), i.model.removeBuffer(s.BufferType.无敌), i.model.removeBuffer(s.BufferType.变身),
                        i.sprite && i.canShowGun() && (i.sprite.node.opacity = 255);
                }), -29 != this.model.personIdx && 128 != this.model.personIdx || (this.model.addBuffer(s.BufferType.冲击),
                    this.schedule(function() {
                        var e, t;
                        i.model.hasBuffer(s.BufferType.冲击) && ((e = new s.default()).RAN = 330, e.MOV = 100,
                            e.pow = 200, e.type = s.ArmType.冲击, e.ATK = 400 + Math.floor(20 * i.model.gunIdx),
                            (t = i.gameView.getArm().getComponent(l.default)) && (t.node.angle = 0, t.node.setParent(i.gameView.bulletLayout),
                                t.node.setPosition(i.node.getPosition()), t.init(i, e, cc.Vec2.ZERO, i.node.getPosition())));
                    }, 2)), this.gameView.updateRank(this, 1), this.topNode && !this.topNode.active && (this.topNode.active = !0,
                    this.topNode.setPosition(this.node.getPosition())), this.bottomNode && !this.bottomNode.active && (this.bottomNode.active = !0,
                    this.bottomNode.setPosition(this.node.getPosition())), this.pet && this.pet.awake(),
                c.default.getInstance().checkGame() && c.default.getInstance().endGame());
        }, e.prototype.isAttack = function(e) {
            var t = this;
            if (this.checkTarget(this) && this.checkTarget(e) && this.canAttack()) {
                var i = this.node.getPosition(),
                    o = e.node.getPosition(),
                    n = i.sub(o).mag();
                return e.model.hasBuffer(s.BufferType.隐藏中) && this.getModel().RAN > 80 * c.default.getInstance().fieldgird && (n += this.getModel().RAN - 80 * c.default.getInstance().fieldgird), !(n > this.getModel().RAN || this.gameView.astar.retrieve(this.getRect(i, o, 20)).some(function(e) {
                    return -1 < t.attackCan.indexOf(e.type) && cc.Intersection.lineRect(i, o, e.node.getBoundingBox());
                }));
            }
            return !1;
        }, e.prototype.doAttack = function() {
            var e = this;
            if (!this.checkTarget(this) || !this.canAttack()) return !1;
            if (this.modelType == r.MACHINE) return D.default.getInstance().doAttack(this);
            if (this.isFill || this.isIdle) return !0;
            if (this.doAttackGun()) {
                if (P.GD.isEffect) switch (this.model.fire) {
                    case s.FireType.手枪:
                        d.default.getInstance().playAudio("手枪", .3);
                        break;

                    case s.FireType.冲锋枪:
                        d.default.getInstance().playAudio("冲锋枪", 1);
                        break;

                    case s.FireType.暴力枪:
                    case s.FireType.狙击枪:
                        d.default.getInstance().playAudio("狙击枪", 1);
                        break;

                    case s.FireType.加特林:
                        d.default.getInstance().playAudio("加特林", 1);
                        break;

                    case s.FireType.闪电枪:
                        d.default.getInstance().playAudio("闪电枪", .3);
                        break;

                    case s.FireType.科技枪:
                        d.default.getInstance().playAudio("科技枪", .3);
                        break;

                    case s.FireType.激光枪:
                        d.default.getInstance().playAudio("激光枪");
                        break;

                    case s.FireType.落冰枪:
                        d.default.getInstance().playAudio("手枪", .3);
                        break;

                    case s.FireType.彩蛋枪:
                        d.default.getInstance().playAudio("冲锋枪", 1);
                        break;

                    default:
                        d.default.getInstance().playAudio("狙击枪", 1);
                }
                for (var t = this.model.getCount(), i = 0; i < t; i++) {
                    var o = this.gameView.getArm().getComponent(l.default);
                    o && (o.node.setParent(this.gameView.bulletLayout), o.node.setPosition(this.node.getPosition().add(this.getOffect())),
                        this.model.openid == GA.Info.openId || this.model.type != s.ArmType.狙击枪 && this.model.type != s.ArmType.导弹枪 ? o.init(this, cc.instantiate(this.model), this.getDir(), this.node.getPosition().add(this.getOffect())) : o.init(this, cc.instantiate(this.model), this.getDir().rotate(cc.misc.degreesToRadians(20 * (Math.random() - .5))), this.node.getPosition().add(this.getOffect())),
                        this.offect = this.getDir().mul(2 * -this.model.pow));
                }
                this.addFire(), 0 < this.model.IDLE && (this.isIdle || (this.isIdle = !0, this.scheduleOnce(function() {
                    e.isIdle = !1;
                }, this.model.IDLE))), 0 < this.model.time && this.model.addCount(t) && (this.isFill = !0,
                    this.fillView && this.fillView.init(this.model.time), this.scheduleOnce(function() {
                        e.isFill = !1, e.model.clearCount();
                    }, this.model.time));
            }
            return !0;
        }, e.prototype.doAttackGun = function() {
            var i, o, n, a, d = this;
            if (this.model.type == s.ArmType.手枪) !this.isSkill && Math.random() < .1 && (this.isSkill = !0,
                this.model.addBuffer(s.BufferType.施放), (i = cc.instantiate(this.model)).ATK_ORG = Math.round(.5 * i.ATK_ORG),
                i.ATK = Math.round(.5 * i.ATK), cc.tween(this.node).delay(1).repeat(20, cc.tween().call(function() {
                    var e = d.gameView.getArm().getComponent(l.default),
                        t = d.getOffect(GA.rand(-100, 100), GA.rand(-100, 100)),
                        t = d.node.getPosition().add(t);
                    e && (e.node.setPosition(t), e.node.setParent(d.gameView.bulletLayout), e.init(d, i, d.getDir(), t));
                }).delay(.05)).start(), cc.tween(this.node).delay(1.5).call(function() {
                    d.model.removeBuffer(s.BufferType.施放);
                }).delay(4.5).call(function() {
                    d.isSkill = !1;
                }).start(), this.playEffectSkill());
            else if (this.model.type == s.ArmType.反弹枪) !this.isSkill && Math.random() < .1 && (this.isSkill = !0,
                this.model.addBuffer(s.BufferType.施放), o = cc.instantiate(this.model), n = f.G.getCirclePoints(1, cc.v2(0, 0), 8, .5),
                a = 0, cc.tween(this.node).delay(1).repeat(24, cc.tween().call(function() {
                    var e = d.gameView.getArm().getComponent(l.default),
                        t = n[a % n.length];
                    a++;
                    var i = d.node.getPosition().add(t),
                        t = t.normalize().neg();
                    e && (e.node.setPosition(i), e.node.setParent(d.gameView.bulletLayout), e.init(d, o, t, i));
                }).delay(.1)).start(), cc.tween(this.node).delay(1.5).call(function() {
                    d.model.removeBuffer(s.BufferType.施放);
                }).delay(4.5).call(function() {
                    d.isSkill = !1;
                }).start(), this.playEffectSkill());
            else if (this.model.type == s.ArmType.狙击枪) this.aimTime = 0;
            else if (this.model.type == s.ArmType.导弹枪) this.aimTime = 0;
            else if (this.model.type == s.ArmType.激光枪) {
                if (this.chargeTime >= this.chargeTotalTime) {
                    var e = cc.instantiate(this.model);
                    e.ATK_ORG = Math.round(.4 * e.ATK_ORG), e.ATK = Math.round(.4 * e.ATK);
                    var t = new k.default({
                        player: this,
                        config: {
                            id: 4,
                            type: s.ArmType.激光枪,
                            rate: 100,
                            scale: 20,
                            options: {
                                num: 20
                            }
                        }
                    });
                    return t.chargeTime = this.chargeTime, t.chargeTotalTime = this.chargeTotalTime,
                        t.doSkill({
                            model: e,
                            pos: this.node.getPosition().add(this.getOffect()),
                            dir: this.getDir()
                        }), this.skillList.push(t), this.chargeTime = 0, !1;
                }
                this.chargeTime = 0;
            }
            return !0;
        }, e.prototype.playEffectSkill = function() {
            var t = this;
            this.gameView.appendSkeleton({
                url: "skeleton/game/施放/skeleton",
                root: this.node,
                pos: cc.Vec2.ZERO
            }).then(function(e) {
                e.premultipliedAlpha = false,
                    e.node.setScale(5), e.setAnimation(0, "penzi", !1), e.setCompleteListener(function() {
                        t.gameView.removeSkeleton(e.node);
                    });
            });
        }, e.prototype.addFire = function() {
            this.fire || (this.fire = this.gameView.getFire().getComponent(u.default), this.fire.node.setParent(this.node),
                this.updateFire(), this.fire.init(this.model)), this.fire.doFire();
        }, e.prototype.updateFire = function() {
            var e;
            this.fire && this.fire.node && (e = this.getDir(), this.fire.node.setPosition(this.getOffect()),
                0 == e.x ? 0 < e.y ? this.fire.node.angle = 90 : e.y < 0 ? this.fire.node.angle = -90 : this.fire.node.angle = 0 : this.fire.node.angle = cc.misc.radiansToDegrees(Math.atan2(e.y, e.x)));
        }, e.prototype.removeFire = function() {
            this.fire && (this.fire.stopFire(), this.gameView.putFire(this.fire.node), this.fire = null);
        }, e.prototype.doHurt = function(t, e) {
            var i, o = this;
            this.checkTarget(this) && this.canHurt() && (GA.rand(0, 100) < this.model.miss ? -28 == this.model.personIdx || 127 == this.model.personIdx ? this.isBaoQing || (this.isBaoQing = !0,
                this.gameView.appendSprite({
                    url: "texture/battle/miss2",
                    root: this.topNode,
                    pos: cc.v2(0, 140)
                }).then(function(e) {
                    e.node.angle = 0, e.node.scale = .7, cc.tween(e.node).delay(2).call(function() {
                        o.isBaoQing = !1, o.gameView.removeSprite(e.node);
                    }).start();
                })) : this.gameView.appendSprite({
                url: "texture/battle/miss",
                root: this.gameView.criLayout,
                pos: this.node.getPosition().add(cc.v2(50 * Math.random() - 50, 20 * Math.random() + 100))
            }).then(function(e) {
                e.node.scale = 0, e.node.angle = 0, cc.tween(e.node).then(cc.sequence(cc.scaleTo(.08, 4), cc.delayTime(.2), cc.scaleTo(.08, 0)).easing(cc.easeOut(3))).call(function() {
                    o.gameView.removeSprite(e.node);
                }).start();
            }) : this.modelType == r.METAMORPHIC ? w.default.getInstance().doHurt(this, t, e) : this.modelType == r.MACHINE ? D.default.getInstance().doHurt(this, t, e) : (this.checkHurt(t, e, this.model),
                this.model.isDead() ? (c.default.getInstance().gameView.players.forEach(function(e) {
                    e.model.openid == t.openid && (t.kill_count++, o.gameView.showKill(o, e));
                }), this.die()) : (this.model.hurtCount++, this.canMove() && e && (this.offect = e.mul(10 * t.pow)),
                    this.isHurt || (this.isHurt = !0, i = null, cc.tween(this.skeleton.node).repeat(2, cc.tween().call(function() {
                        o.skeleton.node.color = cc.Color.GRAY;
                    }).delay(.08).call(function() {
                        o.skeleton.node.color = cc.Color.WHITE;
                    }).delay(.08)).call(function() {
                        o.isHurt = !1;
                    }).start(), this.model.hasBuffer(s.BufferType.减伤) && this.gameView.appendSkeleton({
                        url: "buffer/坚如磐石/skeleton",
                        root: this.node,
                        pos: cc.v2(-10, 20)
                    }).then(function(e) {
                        (i = e).setAnimation(0, "animation", !1), i.setCompleteListener(function() {
                            i.setCompleteListener(null), o.gameView.removeSkeleton(i.node);
                        });
                    }), this.model.hasBuffer(s.BufferType.护盾) && this.gameView.appendSkeleton({
                        url: "buffer/护盾/skeleton",
                        root: this.node,
                        pos: cc.v2(0, 10)
                    }).then(function(e) {
                        (i = e).node.scale = .7, i.setAnimation(0, "animation", !1), i.setCompleteListener(function() {
                            i.setCompleteListener(null), o.gameView.removeSkeleton(i.node);
                        });
                    }), this.model.hasBuffer(s.BufferType.狗头) && (d.default.getInstance().playAudio("宠物狗叫"),
                        this.skeleton.setAnimation(0, "hit", !1), this.skeleton.setCompleteListener(function() {
                            o.skeleton.setCompleteListener(null), o.model.hasBuffer(s.BufferType.狗头) && o.skeleton.setAnimation(0, "run", !0);
                        }))), this.checkHurtSkin() && this.checkHurtGun(t))));
        }, e.prototype.checkHurt = function(e, t, i) {
            void 0 === i && (i = this.model);
            var o = Math.floor((1 + (Math.random() - .5) / 10) * e.ATK),
                n = i.isCri(e.CRI);
            this.gameView.appendCri(e.type, this.node.getPosition(), o, n), i.hasBuffer(s.BufferType.护盾) ? (n ? this.metamorphicModel.doHurt(2 * o) : this.metamorphicModel.doHurt(o),
                    this.metamorphicModel.isDead() && i.removeBuffer(s.BufferType.护盾)) : n ? i.doHurt(2 * o) : i.doHurt(o),
                this.hpView.refresh(i.HP);
        }, e.prototype.checkHurtSkin = function() {
            var t, i, o, n, a, h, r, m, p, u = this;
            if (-13 == this.model.personIdx || 112 == this.model.personIdx) {
                if (!this.model.hasBuffer(s.BufferType.电击) && !this.isBaoQing) {
                    this.isBaoQing = !0;
                    try {
                        d.default.getInstance().playAudio("乌蝇哥受打"), this.skeleton.setAttachment("ren/biaoqing-lian-1", "ren/k"),
                            this.scheduleOnce(function() {
                                u.isBaoQing = !1;
                                try {
                                    u.skeleton.setAttachment("ren/biaoqing-lian-1", "ren/biaoqing-lian-1");
                                } catch (e) {}
                            }, 3);
                    } catch (e) {}
                }
            } else if (-14 == this.model.personIdx || 113 == this.model.personIdx) {
                if (!this.metamorphicModel.flag && this.model.HP / this.model.MAX_HP < .5) return w.default.getInstance().change(this), !1;
            } else -17 == this.model.personIdx || 116 == this.model.personIdx ? this.model.HP / this.model.MAX_HP < .5 && (this.model.addBuffer(s.BufferType.加速),
                this.scheduleOnce(function() {
                    u.model.removeBuffer(s.BufferType.加速);
                }, 30), this.model.SPE = 750, 1008 == this.model.gunIdx) && ((t = new s.default()).SPE = 300,
                t.MOV = 600, t.pow = 50, t.type = s.ArmType.回旋, t.bullet = 61, t.ATK = 60 + Math.floor(3 * this.model.gunIdx),
                i = f.G.getCirclePoints(1, cc.v2(0, 0), 8), o = 0, this.schedule(function() {
                    d.default.getInstance().playAudio("飞镖");
                    var e = u.gameView.getArm().getComponent(l.default);
                    e && (e.node.setParent(u.gameView.bulletLayout), e.node.setPosition(u.node.getPosition().add(i[o % i.length].mul(20))),
                            e.init(u, t, i[o % i.length].mul(2), u.node.getPosition().add(i[o % i.length].mul(20)))),
                        o++;
                }, .1, 7)) : -18 == this.model.personIdx || 117 == this.model.personIdx ? this.model.HP / this.model.MAX_HP < .5 && (d.default.getInstance().playAudio("彩蛋皮肤迪迦凹凸曼"),
                this.model.addBuffer(s.BufferType.加速), this.scheduleOnce(function() {
                    u.model.removeBuffer(s.BufferType.加速);
                }, 15), this.model.ATK = this.model.ATK_ORG + 120, this.model.SPE = 600, this.model.CRI = 30,
                this.model.personIdx = 217, this.model.addBuffer(s.BufferType.变身), this.model.addBuffer(s.BufferType.无敌),
                this.loadSkin(this.model.personIdx).then(function() {
                    u.model.removeBuffer(s.BufferType.变身), u.model.removeBuffer(s.BufferType.无敌);
                }), (n = new s.default()).SPE = 300, n.MOV = 600, n.pow = 50, n.type = s.ArmType.回旋,
                n.bullet = 62, n.ATK = 60 + Math.floor(3 * this.model.gunIdx), a = f.G.getCirclePoints(1, cc.v2(0, 0), 8),
                h = 0, this.schedule(function() {
                    d.default.getInstance().playAudio("飞镖");
                    var e = u.gameView.getArm().getComponent(l.default);
                    e && (e.node.setParent(u.gameView.bulletLayout), e.node.setPosition(u.node.getPosition().add(a[h % a.length].mul(20))),
                            e.init(u, n, a[h % a.length].mul(2), u.node.getPosition().add(a[h % a.length].mul(20)))),
                        h++;
                }, .1, 7)) : -19 == this.model.personIdx || 118 == this.model.personIdx ? this.model.HP / this.model.MAX_HP < .5 && (d.default.getInstance().playAudio("彩蛋皮肤盖亚凹凸曼"),
                this.model.addBuffer(s.BufferType.加速), this.scheduleOnce(function() {
                    u.model.removeBuffer(s.BufferType.加速);
                }, 15), this.model.ATK = this.model.ATK_ORG + 300, this.model.SPE = 650, this.model.CRI = 40,
                this.model.personIdx = 218, this.doMedical(3e3), this.model.addBuffer(s.BufferType.变身),
                this.model.addBuffer(s.BufferType.无敌), this.loadSkin(this.model.personIdx).then(function() {
                    u.changeAnimation({
                        animation: "animation6",
                        loop: !1,
                        flag: !0,
                        callback: function() {
                            u.model.removeBuffer(s.BufferType.变身), u.model.removeBuffer(s.BufferType.无敌);
                        }
                    });
                })) : -20 == this.model.personIdx || 119 == this.model.personIdx ? this.model.HP / this.model.MAX_HP < .5 && (d.default.getInstance().playAudio("彩蛋皮肤戴拿凹凸曼"),
                this.model.addBuffer(s.BufferType.加速), this.scheduleOnce(function() {
                    u.model.removeBuffer(s.BufferType.加速);
                }, 15), this.model.ATK = this.model.ATK_ORG + 130, this.model.SPE = 540, this.model.CRI = 30,
                this.model.personIdx = 219, this.model.addBuffer(s.BufferType.变身), this.model.addBuffer(s.BufferType.无敌),
                this.loadSkin(this.model.personIdx).then(function() {
                    var t = new s.default();
                    t.MOV = 1500, t.pow = 200, t.type = s.ArmType.激光枪, t.bullet = 31, t.ATK = 600 + 10 * P.GD.topRank,
                        u.changeAnimation({
                            animation: "animation6",
                            loop: !1,
                            flag: !0,
                            callback: function() {
                                u && (u.model.removeBuffer(s.BufferType.变身), u.model.removeBuffer(s.BufferType.无敌),
                                    u.schedule(function() {
                                        var e;
                                        !u || (e = u.gameView.getArm().getComponent(l.default)) && (e.node.setParent(u.gameView.bulletLayout),
                                            e.node.setPosition(u.node.getPosition().add(u.getOffect()).add(cc.v2(0, 60))), e.init(u, t, cc.v2(u.attackDir || u.moveDir), u.node.getPosition().add(u.getOffect()).add(cc.v2(0, 60))));
                                    }, 2));
                            }
                        });
                })) : -21 == this.model.personIdx || 120 == this.model.personIdx ? !this.metamorphicModel.flag && this.model.HP / this.model.MAX_HP < .5 && (this.metamorphicModel.flag = !0,
                this.model.addBuffer(s.BufferType.变身), this.model.addBuffer(s.BufferType.无敌), this.sprite && (this.sprite.node.opacity = 0),
                this.changeAnimation({
                    animation: "animation6",
                    loop: !0,
                    flag: !0
                }), this.scheduleOnce(function() {
                    u.model.removeBuffer(s.BufferType.变身), u.model.removeBuffer(s.BufferType.无敌), u.sprite && u.canShowGun() && (u.sprite.node.opacity = 255);
                }, 3), this.gameView.targets.forEach(function(t) {
                    t.model.group != u.model.group && t.doDizzy(function(e) {
                        t.scheduleOnce(function() {
                            t.sprite && t.canShowGun() && (t.sprite.node.opacity = 255), t.model.removeBuffer(s.BufferType.眩晕),
                                c.default.getInstance().gameView.removeSkeleton(e.node);
                        }, 12);
                    });
                })) : -23 == this.model.personIdx || 122 == this.model.personIdx || -29 == this.model.personIdx || 128 == this.model.personIdx ? !this.metamorphicModel.flag && this.model.HP / this.model.MAX_HP < .5 && (this.metamorphicModel.flag = !0,
                this.model.addBuffer(s.BufferType.变身), this.model.addBuffer(s.BufferType.无敌), this.sprite && (this.sprite.node.opacity = 0),
                this.changeAnimation({
                    animation: "animation6",
                    loop: !0,
                    flag: !0
                }), this.scheduleOnce(function() {
                    u.model.removeBuffer(s.BufferType.变身), u.model.removeBuffer(s.BufferType.无敌), u.sprite && u.canShowGun() && (u.sprite.node.opacity = 255);
                }, 3), this.gameView.targets.forEach(function(t) {
                    t.model.group != u.model.group && t.doDizzy(function(e) {
                        t.scheduleOnce(function() {
                            t.sprite && t.canShowGun() && (t.sprite.node.opacity = 255), t.model.removeBuffer(s.BufferType.眩晕),
                                c.default.getInstance().gameView.removeSkeleton(e.node);
                        }, 12);
                    });
                })) : -24 == this.model.personIdx || 123 == this.model.personIdx || -29 == this.model.personIdx || 128 == this.model.personIdx ? this.model.HP / this.model.MAX_HP < .5 ? this.model.addBuffer(s.BufferType.减伤) : this.model.removeBuffer(s.BufferType.减伤) : -25 == this.model.personIdx || 124 == this.model.personIdx || -29 == this.model.personIdx || 128 == this.model.personIdx ? this.model.hurtCount % 2 != 0 || this.model.hasBuffer(s.BufferType.隐身) || (this.model.addBuffer(s.BufferType.隐身),
                this.skeleton.node.opacity = 125, this.scheduleOnce(function() {
                    u.skeleton.node.opacity = 255, u.model.removeBuffer(s.BufferType.隐身);
                }, 3)) : -30 == this.model.personIdx || 129 == this.model.personIdx ? this.model.HP / this.model.MAX_HP < .5 && (d.default.getInstance().playAudio("彩蛋皮肤泽塔凹凸曼"),
                c.default.getInstance().gameView.appendSkeleton({
                    url: "skeleton/皮肤泽塔凹凸曼/skeleton",
                    root: this.node,
                    pos: cc.Vec2.ZERO
                }).then(function(e) {
                    e.setAnimation(0, "guang", !1), e.setCompleteListener(function() {
                        c.default.getInstance().gameView.removeSkeleton(e.node);
                    });
                }), this.model.addBuffer(s.BufferType.加速), this.scheduleOnce(function() {
                    u.model.removeBuffer(s.BufferType.加速);
                }, 15), this.model.ATK = this.model.ATK_ORG + 130, this.model.SPE = 540, this.model.CRI = 30,
                this.model.personIdx = 229, this.model.addBuffer(s.BufferType.变身), this.model.addBuffer(s.BufferType.无敌),
                this.loadSkin(this.model.personIdx).then(function() {
                    u.model.removeBuffer(s.BufferType.变身), u.model.removeBuffer(s.BufferType.无敌);
                })) : 229 == this.model.personIdx && !this.metamorphicModel.flag && this.model.HP / this.model.MAX_HP < .15 && (this.metamorphicModel.flag = !0,
                (r = new s.default()).SPE = 300, r.MOV = 600, r.pow = 50, r.type = s.ArmType.回旋,
                r.bullet = 62, r.ATK = 60 + Math.floor(3 * this.model.gunIdx), m = f.G.getCirclePoints(1, cc.v2(0, 0), 8),
                p = 0, this.schedule(function() {
                    d.default.getInstance().playAudio("飞镖");
                    var e = u.gameView.getArm().getComponent(l.default);
                    e && (e.node.setParent(u.gameView.bulletLayout), e.node.setPosition(u.node.getPosition().add(m[p % m.length].mul(20))),
                            e.init(u, r, m[p % m.length].mul(2), u.node.getPosition().add(m[p % m.length].mul(20)))),
                        p++;
                }, .1, 7));
            return !0;
        }, e.prototype.checkHurtGun = function(e) {
            var t = this;
            1006 != e.gunIdx || this.model.hasBuffer(s.BufferType.月饼) ? 1009 != e.gunIdx || this.model.hasBuffer(s.BufferType.狗头) ? e.type == s.ArmType.闪电枪 ? this.doEle(function() {
                t.model.hasBuffer(s.BufferType.变身) ? t.isBaoQing = !1 : t.loadSkin(t.model.personIdx).then(function() {
                    t.skeleton && t.skeleton.node.setPosition(cc.v2(0, -20)), t.isBaoQing = !1;
                });
            }) : e.type == s.ArmType.冰冻枪 ? this.doIce() : e.type == s.ArmType.切割 ? this.doCut() : e.type == s.ArmType.毒液 && this.doVenom() : this.doGT(function() {
                t.model.personIdx = t.originPersonIdx, t.model.hasBuffer(s.BufferType.变身) ? t.isBaoQing = !1 : t.loadSkin(t.model.personIdx).then(function() {
                    t.isBaoQing = !1;
                });
            }) : this.doYB(function() {
                t.model.personIdx = t.originPersonIdx, t.model.hasBuffer(s.BufferType.变身) ? t.isBaoQing = !1 : t.loadSkin(t.model.personIdx).then(function() {
                    t.isBaoQing = !1;
                });
            });
        }, e.prototype.canHurt = function() {
            return this.getModel().canHurt();
        }, e.prototype.die = function() {
            var e, t, i = this;
            this.model.personIdx = this.originPersonIdx, this.unscheduleAllCallbacks(), cc.Tween.stopAllByTarget(this.node),
                cc.Tween.stopAllByTarget(this.skeleton.node), this.pauseMove(!0), this.model.buffers.clear(),
                this._moveSpeed = 0, this.skillList.forEach(function(e) {
                    return e.doDestory();
                }), this.skillList = [], this.topNode && this.topNode.active && (this.topNode.active = !1),
                this.bottomNode && this.bottomNode.active && (this.bottomNode.active = !1), this.sprite && (this.sprite.node.opacity = 0),
                this.isBaoQing = !1, P.GD.isEffect && (d.default.getInstance().playAudio("击杀"), -13 == this.model.personIdx && d.default.getInstance().playAudio("乌蝇哥死亡")), this.removeFire(),
                this.target = null, this.model.rank = c.default.getInstance().model.players.filter(function(e) {
                    return !e.isDead();
                }).length, this.gameView.updateRank(this, 0), -16 == this.model.personIdx ? (d.default.getInstance().playAudio("回来", 3),
                    this.hpView.node.active = !1, e = 0 < this.skeleton.node.scaleX ? 1 : -1, t = this.node.getPosition(),
                    this.node.opacity, cc.tween(this.node).parallel(cc.tween().by(1.8, {
                        position: cc.v2(800 * e, 666),
                        angle: 4e3
                    }), cc.tween().to(1.8, {
                        scale: 4
                    }), cc.tween().delay(1.4).to(.4, {
                        opacity: 0
                    })).call(function() {
                        i.node && (i.node.active = !1, i.node.setPosition(t), i.node.angle = 0, i.node.scale = 1,
                            i.node.opacity = 255), i.doAccount();
                    }).start()) : (this.skeleton && this.skeleton.node.active ? (this.skeleton.unscheduleAllCallbacks(),
                    this.skeleton.clearTracks(), this.loadSkin(this.model.personIdx).then(function() {
                        i.skeleton && (i.skeleton.node.color = cc.Color.WHITE, i.skeleton.node.setPosition(cc.v2(0, -20)),
                            i.changeAnimation({
                                animation: "animation5",
                                loop: !1,
                                flag: !0,
                                callback: function() {
                                    i.node && (i.node.active = !1);
                                }
                            }));
                    })) : this.node && (this.node.active = !1), this.doAccount()), this.pet && (this.model.openid == GA.Info.openId ? this.pet.sleep() : this.checkTarget(this.pet) && (this.pet.model.state = s.PlayerState.死亡,
                    this.pet.die()));
        }, e.prototype.doAccount = function() {
            var e, t = this;
            c.default.getInstance().matchType == c.MatchType.三对三 ? this.model.openid == GA.Info.openId ? c.default.getInstance().restartcount < 1 ? c.default.getInstance().loseGame() : c.default.getInstance().checkGame() ? c.default.getInstance().endGame() : c.default.getInstance().visitGame() : c.default.getInstance().checkGame() ? c.default.getInstance().endGame() : this.gameView.followPlayer != this || 0 < (e = this.gameView.players.filter(function(e) {
                return !e.model.isDead() && e.model.group == t.gameView.followPlayer.model.group;
            })).length && (this.gameView.followPlayer = e[0]) : c.default.getInstance().matchType != c.MatchType.正常 && c.default.getInstance().matchType != c.MatchType.引导 || (this.model.openid == GA.Info.openId ? c.default.getInstance().restartcount < 1 ? c.default.getInstance().loseGame() : (c.default.getInstance().checkGame(),
                c.default.getInstance().endGame()) : c.default.getInstance().checkGame() && c.default.getInstance().endGame());
        }, e.prototype.doMedical = function(e, t, i) {
            void 0 === t && (t = 0), void 0 === i && (i = this.getModel()), o.prototype.doMedical.call(this, e, t, i);
        }, e.prototype.getOffect = function(e, t) {
            return void 0 === e && (e = 0), void 0 === t && (t = 0), this.modelType == r.MACHINE ? D.default.getInstance().getOffect(this, e, t) : o.prototype.getOffect.call(this, e, t);
        }, e.prototype.updateDir = function(e) {
            void 0 === e && (e = this.moveDir), this.modelType == r.MACHINE ? D.default.getInstance().updateDir(this, e) : o.prototype.updateDir.call(this, e);
        }, e.prototype.updateAtkDir = function(e) {
            var t;
            e ? (t = this.getModel(), e = e.node.getPosition().sub(this.node.getPosition()),
                (t.openid == GA.Info.openId || t.type != s.ArmType.狙击枪 && t.type != s.ArmType.导弹枪 || !(e.mag() < 1e3)) && e.mag() > t.RAN ? (this.attacking = !1,
                    0 == this.moveDir.x && 0 == this.moveDir.y && (this.moveDir = 0 < this.skeleton.node.scaleX ? cc.v2(-1, 0) : cc.v2(1, 0)),
                    this.updateDir(this.attackDir || this.moveDir)) : (this.attacking = !0, this.updateDir(e.normalize()))) : (this.attacking = !1,
                0 == this.moveDir.x && 0 == this.moveDir.y && (this.moveDir = 0 < this.skeleton.node.scaleX ? cc.v2(-1, 0) : cc.v2(1, 0)),
                this.updateDir(this.attackDir || this.moveDir));
        }, e.prototype.getDir = function(e) {
            return void 0 === e && (e = this.target), this.checkTarget(e) ? cc.v2(e.node.getPosition().sub(this.node.getPosition()).normalizeSelf()) : this.attackDir || this.moveDir;
        }, e.prototype.showCircle = function() {
            this.circle && !this.circle.node.active && (this.circle.node.active = !0);
        }, e.prototype.hideCircle = function() {
            this.circle && (this.circle.node.active = !1);
        }, e.prototype.showLine = function() {
            this.line && (this.line.active || (this.line.active = !0), this.line.getComponent(M.default).doInit({
                pos: this.node.getPosition().add(this.getOffect()),
                dir: this.getDir()
            }));
        }, e.prototype.hideLine = function() {
            this.line && (this.line.active && (this.line.active = !1), this.line.getComponent(M.default).doReset());
        }, e.prototype.update = function(e) {
            var t = this;
            if (this.checkTarget(this)) {
                if (this.isStart) {
                    if (this.model.updateBuffer(e), this.model.hasBuffer(s.BufferType.隐藏中) ? this.model.group == this.gameView.curPlayer.model.group ? (this.node.opacity = 150,
                            this.topNode.opacity = 150, this.bottomNode.opacity = 150) : 0 < (i = this.gameView.targets.filter(function(e) {
                            return e.model.group == t.gameView.curPlayer.model.group;
                        }).filter(function(e) {
                            return e.checkVisual(t.node.getPosition());
                        })).length ? (this.model.addBuffer(s.BufferType.暴露中, 3), this.node.opacity = 150,
                            this.topNode.opacity = 150, this.bottomNode.opacity = 150, i.forEach(function(e) {
                                return e.model.addBuffer(s.BufferType.暴露中, 3);
                            })) : (this.node.opacity = 0, this.topNode.opacity = 0, this.bottomNode.opacity = 0) : (this.node.opacity = 255,
                            this.topNode.opacity = 255, this.bottomNode.opacity = 255), this.gameView.checkVisual(this.node.getPosition()),
                        this.circle && this.circle.node.active && (this.circle.clear(), this.circle.circle(this.node.x, this.node.y, this.getModel().RAN),
                            this.circle.fill(), this.circle.stroke()), 1 < this.offect.mag() ? this.offect = this.offect.mul(.9) : this.offect = cc.Vec2.ZERO,
                        this.fire && this.updateFire(), this.modelType == r.MACHINE) this.sprite && (this.sprite.node.opacity = 0);
                    else if (this.sprite && this.sprite.node.active && this.slot && this.slot.bone && this.sprite.node.setPosition(cc.v2(this.slot.bone.worldX * this.skeleton.node.scaleX, this.slot.bone.worldY * this.skeleton.node.scaleY - 20)),
                        GA.Info.openId == this.model.openid)
                        if (this.model.hasBuffer(s.BufferType.蓄力)) this.isIdle || this.isFill ? (this.chargeTime = 0,
                            this.hideLine()) : (this.chargeTime < this.chargeTotalTime && (this.chargeTime += e,
                                this.chargeTime >= this.chargeTotalTime && this.playEffectSkill()), .2 <= this.chargeTime && this.showLine(),
                            this.line && (this.line.getComponent(M.default).doInit({
                                pos: this.node.getPosition().add(this.getOffect()),
                                dir: this.getDir()
                            }), this.line.getComponent(M.default).doUpdate(e)));
                        else if (this.model.hasBuffer(s.BufferType.瞄准))
                        if (this.isIdle || this.isFill) this.aimTime = 0,
                            this.hideLine();
                        else {
                            this.aimTime < this.aimTotalTime && (this.aimTime += e, this.aimTime >= this.aimTotalTime && this.playEffectSkill()),
                                .2 <= this.aimTime && this.showLine(), this.line && (this.line.getComponent(M.default).doInit({
                                    pos: this.node.getPosition().add(this.getOffect()),
                                    dir: this.getDir()
                                }), this.line.getComponent(M.default).doUpdate(e));
                            try {
                                .5 < this.gameView.followCamera.zoomRatio && (this.gameView.followCamera.getComponent(g.default).updatePos(this.gameView.followCamera.zoomRatio - e / 2),
                                    this.gameView.followCamera.zoomRatio -= e / 2, this.gameView.roleCamera.zoomRatio = this.gameView.followCamera.zoomRatio);
                            } catch (e) {}
                        }
                    else this.chargeTime = 0, this.aimTime = 0, this.hideLine();
                    for (var i, o = 0; o < this.skillList.length;) this.skillList[o].isDestory ? this.skillList.splice(o, 1) : o++;
                    if (GA.Info.openId == this.model.openid)
                        if (this.model.hasBuffer(s.BufferType.瞄准) || this.model.hasBuffer(s.BufferType.施放)) this.hideCircle();
                        else {
                            this.gameView.attackView.isAttack ? (this.showCircle(), this.circle && ((i = this.circle.getComponent(cc.Graphics)).clear(),
                                i.circle(this.node.x, this.node.y, this.model.RAN), i.fill(), i.stroke())) : this.hideCircle();
                            try {
                                this.gameView.followCamera.zoomRatio < c.default.getInstance().zoomratio ? (this.gameView.followCamera.getComponent(g.default).updatePos(this.gameView.followCamera.zoomRatio + e / 2),
                                    this.gameView.followCamera.zoomRatio += e / 2, this.gameView.followCamera.zoomRatio > c.default.getInstance().zoomratio && (this.gameView.followCamera.getComponent(g.default).updatePos(c.default.getInstance().zoomratio),
                                        this.gameView.followCamera.zoomRatio = c.default.getInstance().zoomratio), this.gameView.roleCamera.zoomRatio = this.gameView.followCamera.zoomRatio) : this.gameView.followCamera.zoomRatio > c.default.getInstance().zoomratio && (this.gameView.followCamera.getComponent(g.default).updatePos(this.gameView.followCamera.zoomRatio - e),
                                    this.gameView.followCamera.zoomRatio -= e, this.gameView.followCamera.zoomRatio < c.default.getInstance().zoomratio && (this.gameView.followCamera.getComponent(g.default).updatePos(c.default.getInstance().zoomratio),
                                        this.gameView.followCamera.zoomRatio = c.default.getInstance().zoomratio), this.gameView.roleCamera.zoomRatio = this.gameView.followCamera.zoomRatio);
                            } catch (e) {}
                        }
                    if (this.canMove()) {
                        if (this.model.hasBuffer(s.BufferType.月饼)) this.isYueBing || (this.isYueBing = !0,
                            this.moveDir = cc.v2(Math.random() - .5, Math.random() - .5).normalizeSelf(), this.scheduleOnce(function() {
                                t.isYueBing = !1;
                            }, .5));
                        else if (this.model.hasBuffer(s.BufferType.狗头)) this.isGouTou || (this.isGouTou = !0,
                            this.moveDir = cc.v2(Math.random() - .5, Math.random() - .5).normalizeSelf(), this.scheduleOnce(function() {
                                t.isGouTou = !1;
                            }, .5));
                        else switch (this._speedType) {
                            case h.default.SpeedType.STOP:
                                this._moveSpeed = 0, this.changeAnimation({
                                    animation: "animation2",
                                    loop: !0
                                });
                                break;

                            case h.default.SpeedType.NORMAL:
                            case h.default.SpeedType.FAST:
                                this._moveSpeed = this.getModel().SPE, this.changeAnimation({
                                    animation: "animation1",
                                    loop: !0
                                });
                        }
                        this.move(e);
                    }
                }
                this.topNode && this.topNode.active && this.topNode.setPosition(this.node.getPosition()),
                    this.bottomNode && this.bottomNode.active && this.bottomNode.setPosition(this.node.getPosition());
            }
        }, a([R(p.default)], e.prototype, "fillView", void 0), a([R(cc.Graphics)], e.prototype, "circle", void 0),
        a([R(cc.Node)], e.prototype, "line", void 0), a([O], e);
}(C.default);

n.default = T;